package com.wdzl.unit;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Time {
    public static Date Datedemo(String str) throws ParseException {
        //将字符串日期转为Date类型,并返回该Date类型
        SimpleDateFormat date = new SimpleDateFormat ("yyyy-MM-dd");
        Date date1 = date.parse (str);
        return date1;
    }
}